from django.template import Library
from datetime import date
from time import strptime

def to_date(value):
    # Fri, 20 Apr 2007 15:57:06 -0400
    date(*strptime(value, '%a, %d %b %Y %H:%M:%S')[:6]).strftime(newdateformat)
    return newdateformat

register = Library()
register.filter('to_date', to_date)

